<?php
declare(strict_types=1);

namespace app\index\controller\api;

use Swoole\Http\Request;
use Swoole\Http\Response;

class App {
    /**
     * [小程序接口] 获取商品列表
     */
    public function goods(Request $request, Response $response){
        $mid = 103;
        $m = \lib\Merchant::get($mid);
        return $m->call('goods', null, 18000, function(array $data){});
    }

    /**
     * [小程序接口] 获取分类信息
     */
    public function category(Request $request, Response $response){
        $mid = 103;
        $m = \lib\Merchant::get($mid);
        return $m->call('category', null, 18000, function(array $data){});
    }

    /**
     * [小程序接口] 下单购买商品
     */
    public function order(Request $request, Response $response){
        $mid = 103;
        $m = \lib\Merchant::get($mid);
        return $m->call('app.buy', null, 18000, function(array $data){});
    }
}